<% layout('/layouts/default.html', {title: '反馈', libs: ['validate','fileupload']}){ %>
<style>
	.lh-contentText {

		word-wrap: break-word;
		word-break: break-word;
	}
	.circle {
		border-radius: 50%;
		display: inline-block;
		margin-right: 10px;
		width: 10px;
		height: 10px;
		background: #00FF7F;
	}
	.circle1 {
		border-radius: 50%;
		display: inline-block;
		margin-right: 10px;
		width: 10px;
		height: 10px;
		background: #FF0000;
	}
	.circle2 {
		border-radius: 50%;
		display: inline-block;
		margin-right: 10px;
		width: 10px;
		height: 10px;
		background: #A9A9A9;
	}
	.newBox{
		width: 100%;
		position: relative;
		height: 100%;
		overflow: hidden;
	}
	.detailLeft{

		height: 100%;
		border-radius: 4px;
		overflow: auto;
		-webkit-box-sizing: border-box;
		box-sizing: border-box;
		width: calc(100% - 380px);
		margin-right: 10px;
		float: left;
	}
	.mainDepBoxright{

		height: 100%;
		border-radius: 4px;
		overflow:hidden;
		width: 370px;
		float: right;
		background: #ffffff;
	}
	.mainDepTopFix{
		height: 54px;
		line-height: 36px;
		margin-bottom: 10px;
		padding-left: 10px;
		-webkit-box-sizing: border-box;
		box-sizing: border-box;
		background: #fff;
		overflow: hidden;
	}
	.mainTopCen{
		padding: 0 10px 30px 10px;
		margin-bottom: 10px;
		border-radius: 4px;
		background: #fff;
	}
	.round{
		border-radius: 50%;
		background-color: #f88f06;
		width: 20px;
		height: 20px;
		display: inline-block;
		text-align: center;
		margin: 0px 5px;
		color: white;
		/*animation:anim 1s infinite;*/
	}


	.row{
		margin: 20px 10px !important;
	}
	.hide{
		color: #acacac!important;
	}
	.text{
		word-wrap: break-word;
	}

	@keyframes anim {
		0%{
			background-color: blue;
		}
		25%{
			background-color: red;
		}
		50%{
			background-color: gold;
		}
		75%{
			background-color: green;
		}
		100%{
			background-color: gray;
		}
	}
</style>
<!--<div class="ui-layout-north">-->
<!--<div class="main-content">-->
<!--	<div class="box box-main">-->

<!--	</div>-->
<!--</div>-->
<!--</div>-->

<div class="ui-layout-center">
	<div class="main-content">
		<div class="box1 box-main newBox">
			<div class="detailLeft">
				<div class="box-header with-border mainDepTopFix">
					<div class="box-title">
						<button type="button" id="top" class="btn btn-default btn-sm" onclick="js.closeCurrentTabPage()" style="background: #FFF;border: 1px solid #DCDFE6;color: #606266;">${text('关 闭')}</button>
					</div>
<!--					<div style="float: right;">-->
<!--						<span><span class="circle"></span>正常推进</span>&emsp;-->
<!--						<span><span class="circle1"></span>未达标或不及预期</span>&emsp;-->
<!--						<span><span class="circle2"></span>未开始</span>-->
<!--					</div>-->
					<div style="float: right;">
						逾期未反馈次数<span style="line-height:1.4em;" class="round">${dcSupTaskActionRes.overTime}</span>
						<a style="cursor:pointer;" onclick=clickWatch()>查看></a>
					</div>
				</div>
				<#form:form id="inputForm" model="${taskReceiveOne}" action="${ctx}/audit/taskReceive/feedback" method="post" class="form-horizontal">
				<div class="box-body mainTopCen ">
					<h5>${dcSupTaskInfoRes.taskContent!'无'}</h5>
					<div><span style="color:#A9A9A9">牵头责任单位 :</span><span>  ${dcSupTaskActionRes.leaderOrgName!'无'}</span></div>
					<% if (dcSupTaskActionRes.explainContent!=null){ %>
					<div><span style="color:#A9A9A9">领导批示 :</span><span class="text">  ${dcSupTaskActionRes.explainContent}</span></div>
					<% } %>
					<% if (taskReceiveOne.feedbackRequire!=null){ %>
					<div><span style="color:#A9A9A9">分阶段目标任务 :</span><span>  ${taskReceiveOne.feedbackRequire}</span></div>
					<% } %>
				</div>
				<div class="box-footer">
					<div class="row">
						<div class="col-xs-12">
							<div class="form-group">
								<label class="control-label col-sm-2" title="">
									<span class="required">*</span> 反馈截止日期：<i class="fa icon-question hide"></i></label>
								<div class="col-sm-8">
									<#form:hidden path="id"/>
									<#form:hidden path="isNewRecord"/>
									<#form:hidden path="taskId"/>
									<#form:hidden path="actionId"/>
									<#form:hidden path="feedbackStatus" defaultValue="2"/>
									<#form:input path="feedbackEndTimeStr" maxlength="100" class="form-control required " readonly="true"/>
								</div>
							</div>
						</div>
					</div>
					<div class="row">
						<div class="col-xs-12">
							<div class="form-group">
								<label class="control-label col-sm-2" title="">
									<span class="required">*</span> 最新进展情况：<i class="fa icon-question hide"></i></label>
								<div class="col-sm-8">
									<#form:textarea path="feedbackContent" placeholder="请逐条填写, 新增一条则另起一行, 450字以内" rows="4" maxlength="450" style="white-space: pre-line;" class="form-control required"/>
								</div>
							</div>
						</div>
					</div>
					<div class="row">
						<div class="col-xs-12">
							<div class="form-group">
								<label class="control-label col-sm-2" title="">
									<span class="required hide">*</span> 存在问题：<i class="fa icon-question hide"></i></label>
								<div class="col-sm-8">
									<#form:textarea path="feedbackAdvice" placeholder="请逐条填写, 新增一条则另起一行, 150字以内" rows="4" maxlength="150" style="white-space: pre-line;" class="form-control"/>
								</div>
							</div>
						</div>
					</div>
					<div class="row">
						<div class="col-xs-12">
							<div class="form-group">
								<label class="control-label col-sm-2" title="">
									<span class="required hide">*</span> 拟采取的工作举措：<i class="fa icon-question hide"></i></label>
								<div class="col-sm-8">
									<#form:textarea path="feedbackMeasure" rows="4" placeholder="请逐条填写, 新增一条则另起一行, 200字以内" maxlength="200" style="white-space: pre-line;" class="form-control"/>
								</div>
							</div>
						</div>
					</div>
					<div class="row">
						<div class="col-xs-12">
								<% if (isxihua=='1'){ %>
							<div class="form-group">
								<label class="control-label col-sm-2" title="">
									<span class="required">*</span> 完成进度：<i class="fa icon-question hide"></i></label>
								<div class="col-sm-8">
									<#form:radio path="feedbackProgress" dictType="dc_feedback_progress" class="form-control required" defaultValue="1" />
								</div>
							</div>
							<% } %>
							<% if (isxihua=='0'){ %>
							<div class="form-group">
								<label class="control-label col-sm-2" title="">
									<span class="required">*</span> 完成进度：<i class="fa icon-question hide"></i></label>
								<div class="col-sm-8">
									<#form:radio path="feedbackProgress" dictType="dc_feedback_progress" class="form-control required" defaultValue="1" readonly="true"/>
								</div>
							</div>
							<% } %>
						</div>
					</div>
					<div class="row">
						<div class="col-xs-12">
							<div class="form-group">
								<label class="control-label col-sm-2" title="">
									<span class="required">*</span> 完成率：<i class="fa icon-question hide"></i></label>
								<div class="col-sm-8">
									<div class="input-group">
										<#form:input path="feedbackRate" type="number" onblur="testRegx(this)" max="100" data-msg-rangelength="最大值100" dataFormat="number2" class="form-control required"/>
										<span class="input-group-addon">%</span>
									</div>
								</div>
							</div>
						</div>
					</div>
					<div class="row">
						<div class="col-xs-12">
							<div class="form-group">
								<label class="control-label col-sm-2" title="">
									<span class="required">*</span> 是否需要市领导调度：<i class="fa icon-question hide"></i></label>
								<div class="col-sm-8">
									<#form:radio path="dispatchFlag" dictType="sys_yes_no" class="form-control " defaultValue="0" />
								</div>
							</div>
						</div>
					</div>
					<div class="row" id="idOne">
						<div class="col-xs-12">
							<div class="form-group">
								<label class="control-label col-sm-2" title="">
									<span class="required hide">*</span> 选择调度：<i class="fa icon-question hide"></i></label>
								<div class="col-sm-8">
									<#form:radio path="feedbackDispatch" dictType="dc_feedback_dispatch" class="form-control "  />
								</div>
							</div>
						</div>
					</div>
					<div class="row">
						<div class="col-xs-12">
							<div class="form-group">
								<label class="control-label col-sm-2" title="">
									<span class="required">*</span> 反馈人：<i class="fa icon-question hide"></i></label>
								<div class="col-sm-8">
									<#form:input path="feedbackName" maxlength="64" class="form-control required "/>
								</div>
							</div>
						</div>
					</div>
					<div class="row">
						<div class="col-xs-12">
							<div class="form-group">
								<label class="control-label col-sm-2" title="">
									<span class="required">*</span> 反馈人电话：<i class="fa icon-question hide"></i></label>
								<div class="col-sm-8">
									<#form:input path="feedbackPhone" maxlength="100" class="form-control required mobile"/>
								</div>
							</div>
						</div>
					</div>
					<div class="row">
						<div class="col-xs-12">
							<div class="form-group">
								<label class="control-label col-sm-2" title="">
									<% if(dcSupTaskInfoRes.attachmentFlag=='1'){ %>
									<span class="required">*</span> 附件上传：<i class="fa icon-question hide"></i></label>
									<div class="col-sm-8 ">
										<#form:fileupload id="upload1" bizKey="${taskReceiveOne.id}" bizType="dcSupTaskFeedback_file"
										uploadType="all" class="required" readonly="false" preview="true"/>
									</div>
								<%  }else if(dcSupTaskInfoRes.attachmentFlag=='0'){ %>
								<span class="required hide">*</span> 附件上传：<i class="fa icon-question hide"></i></label>
								<div class="col-sm-8 ">
									<#form:fileupload id="upload1" bizKey="${taskReceiveOne.id}" bizType="dcSupTaskFeedback_file"
									uploadType="all" class="" readonly="false" preview="true"/>
								</div>
								<%  }%>

							</div>
						</div>
					</div>
					<!--<div class="row">
						<div class="col-xs-12">
							<div class="form-group">
								<label class="control-label col-sm-2" title="">
									<span class="required hide">*</span> 审核人：<i class="fa icon-question hide"></i></label>
								<div class="col-sm-8">
									&lt;!&ndash;<#form:treeselect id="testUser" title="用户选择" path="auditorCode" labelPath="auditorName"
									url="${ctx}/sys/office/treeData?isLoadUser=true" class="" allowClear="true"/>&ndash;&gt;

									<#form:listselect id="auditorCode" title="用户选择"
									url="${ctx}/sys/empUser/empUserSelect" allowClear="false"
									checkbox="false" itemCode="auditorCode" itemName="auditorName"/>
								</div>
							</div>
						</div>
					</div>-->
					<div class="row">
					<div class="col-xs-12">
						<div class="form-group">
							<label class="control-label col-sm-2" title="">
								<span class="required hide">*</span> 审核人：<i class="fa icon-question hide"></i></label>
							<div class="col-sm-8">
								<#form:listselect id="auditor" title="用户选择"
								url="${ctx}/sys/empUser/customizedUserSelect" allowClear="false"
								labelPath="auditorName" path="auditorCode"
								checkbox="false" itemCode="userCode" itemName="userName"/>
							</div>
						</div>
					</div>
					</div>
					<div class="row">
						<div class="col-sm-offset-2 col-sm-10">
							<% if (hasPermi('audit:taskReceive:edit')){ %>
							<button type="submit" class="btn btn-sm btn-primary" id="btnSubmit"><i class="fa fa-check"></i> ${text('立即反馈')}</button>&nbsp;
							<button type="submit" class="btn btn-sm btn-default" id="btnTemp"><i class="fa fa-save"></i> ${text('存为草稿')}</button>&nbsp;
							<% } %>
							<button type="button" class="btn btn-sm btn-default" id="btnCancel" onclick="js.closeCurrentTabPage()"><i class="fa fa-reply-all"></i> ${text('关 闭')}</button>
						</div>
					</div>
				</div>
			    </#form:form>
			</div>
			<div class="ui-layout-content mainDepBoxright">
				<div style="height: 54px;display: flex;align-items: center;position: relative" >
					<span style="position: absolute;left: 10px;font-size: 20px;bottom: 12px">任务信息</span>
<!--
					<button class="btn btn-default btn-sm" style="background: #FFF;border: 1px solid #DCDFE6;color: #606266;position: absolute;right: 10px" onclick="taskLeaderContent()">批示</button>
-->
				</div>
				<div class="box-footer">
					<div class="row">
						<span class="required hide">*</span> ${text('任务年度')}：<i class="fa icon-question hide"></i>
						<span class="lh-contentText">${dcSupTaskInfoRes.taskYear!'无'}</span>
					</div>
					<div class="row">
						<span class="required hide">*</span> ${text('任务标题')}：<i class="fa icon-question hide"></i>
						<span class="lh-contentText">${dcSupTaskInfoRes.taskTitle!'无'}</span>
					</div>
					<div class="row">
						<span class="required hide">*</span> ${text('任务类型')}：<i class="fa icon-question hide"></i>
						<span class="lh-contentText">${dcSupTaskInfoRes.taskTypeName!'无'}</span>
					</div>
					<div class="row">
						<span class="required hide">*</span> ${text('任务内容')}：<i class="fa icon-question hide"></i>
						<span class="lh-contentText">${dcSupTaskInfoRes.taskContent!'无'}</span>
					</div>
					<div class="row">
						<span class="required hide">*</span> ${text('开始时间')}：<i class="fa icon-question hide"></i>
						<span class="lh-contentText">${dcSupTaskInfoRes.taskStartTimeStr!'无'}</span>
					</div>
					<div class="row">
						<span class="required hide">*</span> ${text('结束时间')}：<i class="fa icon-question hide"></i>
						<span class="lh-contentText">${dcSupTaskInfoRes.taskEndTimeStr!'无'}</span>
					</div>
					<div class="row">
						<span class="required hide">*</span> ${text('督办要求')}：<i class="fa icon-question hide"></i>
						<span class="lh-contentText">${dcSupTaskInfoRes.taskRequireName!'无'}</span>
					</div>
					<% if(dcSupTaskInfoRes.normalFlag == '2'){ %>
					<div class="row">
						<span class="required hide">*</span> ${text('协同单位')}：<i class="fa icon-question hide"></i>
						<span class="lh-contentText">${dcSupTaskInfoRes.taskCoopOrgName!'无'}</span>
					</div>
					<div class="row">
						<span class="required hide">*</span> ${text('督办人')}：<i class="fa icon-question hide"></i>
						<span class="lh-contentText">${dcSupTaskInfoRes.taskSupUserName!'无'}</span>
					</div>
					<div class="row">
						<span class="required hide">*</span> ${text('督办科室')}：<i class="fa icon-question hide"></i>
						<span class="lh-contentText">${dcSupTaskInfoRes.taskSupOrgName!'无'}</span>
					</div>
					<% } %>
					<div class="row">
						<span class="required hide">*</span> ${text('牵头领导')}：<i class="fa icon-question hide"></i>
						<span class="lh-contentText">${dcSupTaskInfoRes.taskLeaderName!'无'}</span>
					</div>

					<div class="row">
						<span class="required hide">*</span> ${text('联系人')}：<i class="fa icon-question hide"></i>
						<span class="lh-contentText">${dcSupTaskInfoRes.contactName!'无'}</span>
					</div>
					<div class="row">
						<span class="required hide">*</span> ${text('联系电话')}：<i class="fa icon-question hide"></i>
						<span class="lh-contentText">${dcSupTaskInfoRes.contactPhone!'无'}</span>
					</div>
					<div class="row">
						<span class="required hide">*</span> ${text('发起单位')}：<i class="fa icon-question hide"></i>
						<span class="lh-contentText">${dcSupTaskInfoRes.createOrgName!'无'}</span>
					</div>
					<div class="row">
						<span class="required hide">*</span> ${text('反馈时间要求')}：<i class="fa icon-question hide"></i>
						<span class="lh-contentText">${dcSupTaskInfoRes.remarks2!'无'}</span>
					</div>
					<div class="row">
						<span class="required hide">*</span> ${text('附件上传')}：<i class="fa icon-question hide"></i>
					</div>
					<#form:fileupload id="uploadFile" bizKey="${dcSupTaskInfoRes.id}" bizType="dcSupTaskInfo_file"
					uploadType="all" class="" readonly="true" isMini="true" preview="true"/>
				</div>
			</div>
		</div>
	</div>
</div>
<% } %>
<script>
	$(function (){
		window.location.hash="#top";
		if($('#dispatchFlag input:radio:checked').val()=='0' || $('#dispatchFlag input:radio:checked').val()== null){
			$('#idOne').hide();
		}
	})

	$('#dispatchFlag').on('ifChecked', function(){
		if($('#dispatchFlag input:radio:checked').val()=='1') {
			$('#idOne').show();
		}else{
			$('#idOne').hide();
		}
	});
	// 业务实现草稿按钮
	$('#btnTemp').click(function(){
		$('#feedbackStatus').val(1);
	});

	$('#btnSubmit').click(function(){
		$('#feedbackStatus').val(2);
	});

$("#inputForm").validate({
	submitHandler: function(form){
		js.ajaxSubmitForm($(form), function(data){
			js.showMessage(data.message);
			if(data.result == Global.TRUE){
				js.closeCurrentTabPage(function(contentWindow){
					contentWindow.page();
				});
			}
		}, "json");
    }
});
	//完成率正则表达式校验
	function testRegx(thisObj){

		let _this=thisObj;
		let k=/(^100([.]0{1,2})?)$|(^\d{1,2}([.]\d{1,2})?)$|(^([.]\d{1,2})?)$/;
		let thisValue=$(_this).val();
		if(k.test(thisValue)==false){
			if(thisValue.substring(0,1)=='-'){
				thisValue=thisValue.substring(1,thisValue.length)
			}
			let left = thisValue.substring(0,thisValue.indexOf("."))
			let right = thisValue.substring(thisValue.indexOf(".")+1,thisValue.indexOf(".")+3)
			$("#feedbackRate").val(left+'.'+right);
		}
	}
// 选中事件
$('#feedbackProgress').on('ifChecked', function(){
	if($('#feedbackProgress input:radio:checked').val()=='3'){
		$('#feedbackRate').val(100);
		$('#feedbackRate').attr("readonly","readonly")
	}else{
		$('#feedbackRate').removeAttr("readonly");
		// $('#feedbackRate').val("");
		$('#feedbackRate').val('${taskReceiveOne.feedbackRate}'||"");
	}
});
	if($('#feedbackProgress input:radio:checked').val()=='3'){
		$('#feedbackRate').attr("readonly","readonly")
	}
function clickWatch(){
		js.layer.open({
			type: 2,
			title: [''],
			area: ['300px', '500px'],
			scrollbar: true,
			shadeClose: false,
			content: "${ctx}/audit/taskReceive/taskReceiveThree?id=${dcSupTaskActionRes.id}",
			btn1: function (index, layero) {
			},
			end:function () {
			}
		});
}


	function taskLeaderContent(){
		js.layer.open({
			type: 2,
			title: [''],
			area: ['1000px', '500px'],
			scrollbar: true,
			shadeClose: false,
			content: "${ctx}/audit/taskReceive/getLeaderExplainView?actionId=${dcSupTaskInfoRes.id}",
			btn1: function (index, layero) {
			},
			end:function () {
			}
		});
	}
// 	onchange="changeTime()"
// function changeTime(){
// 	$.ajax({
// 		url:"${ctx}/feedback/dcSupTaskFeedback/getOverRide?feedbackEndTimeStr="+$('#feedbackEndTime').val()+"&actionId=${taskReceiveOne.actionId}",
// 		type:"GET",
// 		success:function(req){
//
// 		},
// 	});
// }


</script>